/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * SplitterUI.java
 *
 * Created on Jul 20, 2011, 3:39:47 PM
 */
package project.jpdftools.pdfsplitter;

import java.awt.Toolkit;
import java.util.logging.Level;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;
import project.jpdftools.constants.Const.SPLIT_METHOD;
import project.jpdftools.constants.Const.SPLIT_OUTPUT_LOCATION;
import project.jpdftools.constants.Const.SPLIT_OUTPUT_NAME;
import project.jpdftools.managers.LocalizationManager;
import project.jpdftools.managers.LoggerManager;
import project.jpdftools.managers.PDFManager;
import project.jpdftools.other.IntegerTextField;

/**
 *
 * @author Mido
 */
public class SplitterUI extends javax.swing.JFrame {

    private static boolean is_component_visible = false;
    private DefaultTableCellRenderer table_cell_renderer = new DefaultTableCellRenderer();

    /**
     * Creates new form SplitterUI
     */
    public SplitterUI() {
        // set cell renderer alignment
        table_cell_renderer.setHorizontalAlignment(JLabel.CENTER);
        // intialize all of the components
        initComponents();

        // indicate that the frame is visible
        is_component_visible = true;
        LoggerManager.getLogger().log(Level.INFO, "Frame shown \"{0}\".", "SplitterUI");
        // intialize the button group components
        bg_split_method_selector.add(rb_even_and_odd);
        bg_split_method_selector.add(rb_into_n_pages);
        bg_split_method_selector.add(rb_from_to);
        bg_split_method_selector.add(rb_into_n_parts);
        bg_split_method_selector.add(rb_extract_pages);
        bg_split_method_selector.add(rb_remove_pages);
        bg_output_file_name.add(rb_same_as_source_file);
        bg_output_file_name.add(rb_use_this_name);
        bg_output_file_location.add(rb_destination_into_subfolder);
        bg_output_file_location.add(rb_destination_same_as_source_file);
        bg_output_file_location.add(rb_destination_use_this_path);
        // intilaize default values
        enableAllComponents(false);

        // resize the main frame after applying the default values
        resizeFrame();
    }

    private void resizeFrame() {
        // resize the main window
        this.setSize(p_all_components.getPreferredSize().width + 5, p_all_components.getPreferredSize().height + 65);
        // center the component in the middle of the screen
        project.jpdftools.toolkit.Toolkit.centerWindow(this, this.getHeight(), this.getWidth());
    }

    private void activateSplitOutputFileLocation(int outputFileLocation) {
        switch (outputFileLocation) {
            case (SPLIT_OUTPUT_LOCATION.none):
                tf_destination_into_subfolder.setEnabled(false);
                tf_destination_use_this_path.setEnabled(false);
                bt_destination_browse.setEnabled(false);
                break;
            case (SPLIT_OUTPUT_LOCATION.same_as_input_file):
                tf_destination_into_subfolder.setEnabled(false);
                tf_destination_use_this_path.setEnabled(false);
                bt_destination_browse.setEnabled(false);
                rb_destination_same_as_source_file.setSelected(true);
                break;
            case (SPLIT_OUTPUT_LOCATION.into_a_subfolder):
                tf_destination_into_subfolder.setEnabled(true);
                tf_destination_use_this_path.setEnabled(false);
                bt_destination_browse.setEnabled(false);
                rb_destination_into_subfolder.setSelected(true);
                break;
            case (SPLIT_OUTPUT_LOCATION.in_this_path):
                tf_destination_into_subfolder.setEnabled(false);
                tf_destination_use_this_path.setEnabled(false);
                bt_destination_browse.setEnabled(true);
                rb_destination_use_this_path.setSelected(true);
                break;
        }
    }

    private void activateSplitOutputFileName(int outputFileName) {
        switch (outputFileName) {
            case (SPLIT_OUTPUT_NAME.none):
                tf_use_this_name.setEnabled(false);
                break;
            case (SPLIT_OUTPUT_NAME.same_as_input_file):
                tf_use_this_name.setEnabled(false);
                rb_same_as_source_file.setSelected(true);
                break;
            case (SPLIT_OUTPUT_NAME.use_this_name):
                tf_use_this_name.setEnabled(true);
                rb_use_this_name.setSelected(true);
                break;
        }
    }

    private void activateSplitMethodComponents(int splitMethod) {
        switch (splitMethod) {
            case (SPLIT_METHOD.none):
                tf_into_n_pages.setEnabled(false);
                tf_from_page.setEnabled(false);
                tf_to_page.setEnabled(false);
                tf_into_n_parts.setEnabled(false);
                tf_extract_pages.setEnabled(false);
                tf_remove_pages.setEnabled(false);
                l_remove_pages_note.setVisible(false);
                l_extract_pages_note.setVisible(false);
                break;
            case (SPLIT_METHOD.even_odd):
                tf_into_n_pages.setEnabled(false);
                tf_from_page.setEnabled(false);
                tf_to_page.setEnabled(false);
                tf_into_n_parts.setEnabled(false);
                tf_extract_pages.setEnabled(false);
                tf_remove_pages.setEnabled(false);
                l_remove_pages_note.setVisible(false);
                l_extract_pages_note.setVisible(false);
                rb_even_and_odd.setSelected(true);
                break;
            case (SPLIT_METHOD.extract_pages):
                tf_into_n_pages.setEnabled(false);
                tf_from_page.setEnabled(false);
                tf_to_page.setEnabled(false);
                tf_into_n_parts.setEnabled(false);
                tf_extract_pages.setEnabled(true);
                tf_remove_pages.setEnabled(false);
                l_remove_pages_note.setVisible(false);
                l_extract_pages_note.setVisible(true);
                rb_extract_pages.setSelected(true);
                break;
            case (SPLIT_METHOD.into_n_pages):
                tf_into_n_pages.setEnabled(true);
                tf_from_page.setEnabled(false);
                tf_to_page.setEnabled(false);
                tf_into_n_parts.setEnabled(false);
                tf_extract_pages.setEnabled(false);
                tf_remove_pages.setEnabled(false);
                l_remove_pages_note.setVisible(false);
                l_extract_pages_note.setVisible(false);
                rb_into_n_pages.setSelected(true);
                break;
            case (SPLIT_METHOD.into_n_parts):
                tf_into_n_pages.setEnabled(false);
                tf_from_page.setEnabled(false);
                tf_to_page.setEnabled(false);
                tf_into_n_parts.setEnabled(true);
                tf_extract_pages.setEnabled(false);
                tf_remove_pages.setEnabled(false);
                l_remove_pages_note.setVisible(false);
                l_extract_pages_note.setVisible(false);
                rb_into_n_parts.setSelected(true);
                break;
            case (SPLIT_METHOD.page_range):
                tf_into_n_pages.setEnabled(false);
                tf_from_page.setEnabled(true);
                tf_to_page.setEnabled(true);
                tf_into_n_parts.setEnabled(false);
                tf_extract_pages.setEnabled(false);
                tf_remove_pages.setEnabled(false);
                l_remove_pages_note.setVisible(false);
                l_extract_pages_note.setVisible(false);
                rb_from_to.setSelected(true);
                break;
            case (SPLIT_METHOD.remove_pages):
                tf_into_n_pages.setEnabled(false);
                tf_from_page.setEnabled(false);
                tf_to_page.setEnabled(false);
                tf_into_n_parts.setEnabled(false);
                tf_extract_pages.setEnabled(false);
                tf_remove_pages.setEnabled(true);
                l_remove_pages_note.setVisible(true);
                l_extract_pages_note.setVisible(false);
                rb_remove_pages.setSelected(true);
                break;
        }
        // resize the main frame
        resizeFrame();
        this.revalidate();
    }

    private void enableAllComponents(boolean b) {
        // activate/deactivate radio buttons
        rb_destination_into_subfolder.setEnabled(b);
        rb_destination_same_as_source_file.setEnabled(b);
        rb_destination_use_this_path.setEnabled(b);
        rb_even_and_odd.setEnabled(b);
        rb_extract_pages.setEnabled(b);
        rb_from_to.setEnabled(b);
        rb_into_n_pages.setEnabled(b);
        rb_into_n_parts.setEnabled(b);
        rb_remove_pages.setEnabled(b);
        rb_same_as_source_file.setEnabled(b);
        rb_use_this_name.setEnabled(b);

        // clear text from all text fields
        tf_destination_into_subfolder.setText("");
        tf_destination_use_this_path.setText("");
        tf_extract_pages.setText("");
        tf_from_page.setText("");
        tf_into_n_parts.setText("");
        tf_into_n_pages.setText("");
        tf_remove_pages.setText("");
        tf_to_page.setText("");
        tf_use_this_name.setText("");

        // clear selection for all button groups
        bg_split_method_selector.clearSelection();
        bg_output_file_location.clearSelection();
        bg_output_file_name.clearSelection();

        // reset options
        activateSplitMethodComponents(SPLIT_METHOD.none);
        activateSplitOutputFileName(SPLIT_OUTPUT_NAME.none);
        activateSplitOutputFileLocation(SPLIT_OUTPUT_LOCATION.none);
    }

    public static boolean IsComponentVisible() {
        return is_component_visible;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        bg_split_method_selector = new javax.swing.ButtonGroup();
        bg_output_file_name = new javax.swing.ButtonGroup();
        bg_output_file_location = new javax.swing.ButtonGroup();
        p_all_components = new javax.swing.JPanel();
        p_step_two = new javax.swing.JPanel();
        rb_into_n_parts = new javax.swing.JRadioButton();
        rb_even_and_odd = new javax.swing.JRadioButton();
        rb_from_to = new javax.swing.JRadioButton();
        rb_into_n_pages = new javax.swing.JRadioButton();
        tf_into_n_pages = new IntegerTextField();
        l_pages = new javax.swing.JLabel();
        tf_from_page = new IntegerTextField();
        l_to_page = new javax.swing.JLabel();
        tf_to_page = new IntegerTextField();
        tf_into_n_parts = new IntegerTextField();
        l_into_n_parts = new javax.swing.JLabel();
        rb_extract_pages = new javax.swing.JRadioButton();
        rb_remove_pages = new javax.swing.JRadioButton();
        l_extract_pages_note = new javax.swing.JLabel();
        tf_extract_pages = new PrinterTextField();
        tf_remove_pages = new PrinterTextField();
        l_remove_pages_note = new javax.swing.JLabel();
        p_step_one = new javax.swing.JPanel();
        bt_remove_all = new javax.swing.JButton();
        bt_browse = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        t_files_to_be_splitted = new javax.swing.JTable();
        bt_remove = new javax.swing.JButton();
        p_step_four = new javax.swing.JPanel();
        rb_destination_use_this_path = new javax.swing.JRadioButton();
        tf_destination_into_subfolder = new javax.swing.JTextField();
        rb_destination_into_subfolder = new javax.swing.JRadioButton();
        tf_destination_use_this_path = new javax.swing.JTextField();
        rb_destination_same_as_source_file = new javax.swing.JRadioButton();
        bt_destination_browse = new javax.swing.JButton();
        p_step_three = new javax.swing.JPanel();
        rb_same_as_source_file = new javax.swing.JRadioButton();
        tf_use_this_name = new javax.swing.JTextField();
        rb_use_this_name = new javax.swing.JRadioButton();
        bt_cancel = new javax.swing.JButton();
        bt_split_all = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_TITLE"));
        setIconImage(Toolkit.getDefaultToolkit().getImage("Data/Icons/Soft Scraps Icons/10.png"));
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                SplitterUI.this.windowClosing(evt);
            }
        });

        p_step_two.setBorder(javax.swing.BorderFactory.createTitledBorder(null, LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_STEP_TWO"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 1, 12), new java.awt.Color(0, 0, 255))); // NOI18N

        rb_into_n_parts.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_INTO"));
        rb_into_n_parts.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rb_into_n_partsActionPerformed(evt);
            }
        });

        rb_even_and_odd.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_BY_EVEN_AND_ODD_PAGES"));
        rb_even_and_odd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rb_even_and_oddActionPerformed(evt);
            }
        });

        rb_from_to.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_FROM_PAGE"));
        rb_from_to.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rb_from_toActionPerformed(evt);
            }
        });

        rb_into_n_pages.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_INTO_FILES_OF_N_PAGES"));
        rb_into_n_pages.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rb_into_n_pagesActionPerformed(evt);
            }
        });

        l_pages.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_PAGES"));

        l_to_page.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_TO_PAGE"));

        l_into_n_parts.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_PARTS"));

        rb_extract_pages.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_EXTRACT_PAGES"));
        rb_extract_pages.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rb_extract_pagesActionPerformed(evt);
            }
        });

        rb_remove_pages.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_REMOVE_PAGES"));
        rb_remove_pages.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rb_remove_pagesActionPerformed(evt);
            }
        });

        l_extract_pages_note.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_EXTRACT_PAGES_NOTE"));

        l_remove_pages_note.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_EXTRACT_PAGES_NOTE"));

        javax.swing.GroupLayout p_step_twoLayout = new javax.swing.GroupLayout(p_step_two);
        p_step_two.setLayout(p_step_twoLayout);
        p_step_twoLayout.setHorizontalGroup(
            p_step_twoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(p_step_twoLayout.createSequentialGroup()
                .addGroup(p_step_twoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(p_step_twoLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(p_step_twoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(rb_remove_pages)
                            .addComponent(rb_extract_pages))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(p_step_twoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(tf_remove_pages)
                            .addComponent(tf_extract_pages)))
                    .addGroup(p_step_twoLayout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(rb_into_n_parts)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(tf_into_n_parts, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(l_into_n_parts))
                    .addGroup(p_step_twoLayout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(rb_even_and_odd))
                    .addGroup(p_step_twoLayout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addComponent(l_extract_pages_note))
                    .addGroup(p_step_twoLayout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addComponent(l_remove_pages_note))
                    .addGroup(p_step_twoLayout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addGroup(p_step_twoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, p_step_twoLayout.createSequentialGroup()
                                .addComponent(rb_into_n_pages)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(tf_into_n_pages, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(l_pages))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, p_step_twoLayout.createSequentialGroup()
                                .addComponent(rb_from_to)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(tf_from_page, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(l_to_page)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(tf_to_page, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        p_step_twoLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {tf_from_page, tf_into_n_pages, tf_into_n_parts, tf_to_page});

        p_step_twoLayout.setVerticalGroup(
            p_step_twoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(p_step_twoLayout.createSequentialGroup()
                .addComponent(rb_even_and_odd)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(p_step_twoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(tf_into_n_pages, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(rb_into_n_pages)
                    .addComponent(l_pages))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(p_step_twoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(rb_from_to)
                    .addComponent(tf_from_page, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(l_to_page)
                    .addComponent(tf_to_page, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(p_step_twoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(l_into_n_parts)
                    .addComponent(tf_into_n_parts, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(rb_into_n_parts))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(p_step_twoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(tf_extract_pages, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(rb_extract_pages))
                .addGap(2, 2, 2)
                .addComponent(l_extract_pages_note)
                .addGap(2, 2, 2)
                .addGroup(p_step_twoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(tf_remove_pages, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(rb_remove_pages))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(l_remove_pages_note)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        p_step_twoLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {tf_from_page, tf_into_n_pages, tf_into_n_parts, tf_to_page});

        p_step_one.setBorder(javax.swing.BorderFactory.createTitledBorder(null, LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_STEP_ONE"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 1, 12), new java.awt.Color(0, 0, 255))); // NOI18N

        bt_remove_all.setIcon(new ImageIcon("Data/Icons/Basic/remove-icon.png"));
        bt_remove_all.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_REMOVE_ALL_FILES"));
        bt_remove_all.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_remove_allActionPerformed(evt);
            }
        });

        bt_browse.setIcon(new ImageIcon("Data/Icons/Basic/Document-Add-icon.png"));
        bt_browse.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_ADD_FILE"));
        bt_browse.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_browseActionPerformed(evt);
            }
        });

        t_files_to_be_splitted.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "", "", ""
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        t_files_to_be_splitted.getTableHeader().setReorderingAllowed(false);
        jScrollPane1.setViewportView(t_files_to_be_splitted);
        t_files_to_be_splitted.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        t_files_to_be_splitted.getColumnModel().getColumn(0).setHeaderValue(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_FILE_NAME"));
        t_files_to_be_splitted.getColumnModel().getColumn(0).setCellRenderer(table_cell_renderer);
        t_files_to_be_splitted.getColumnModel().getColumn(1).setHeaderValue(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_FILE_SIZE"));
        t_files_to_be_splitted.getColumnModel().getColumn(1).setCellRenderer(table_cell_renderer);
        t_files_to_be_splitted.getColumnModel().getColumn(2).setHeaderValue(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_NUMBER_OF_PAGES"));
        t_files_to_be_splitted.getColumnModel().getColumn(2).setCellRenderer(table_cell_renderer);

        bt_remove.setIcon(new ImageIcon("Data/Icons/Basic/page-remove-icon.png"));
        bt_remove.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_REMOVE_FILE"));
        bt_remove.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_removeActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout p_step_oneLayout = new javax.swing.GroupLayout(p_step_one);
        p_step_one.setLayout(p_step_oneLayout);
        p_step_oneLayout.setHorizontalGroup(
            p_step_oneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, p_step_oneLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 307, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(p_step_oneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(bt_remove_all, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bt_remove, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bt_browse))
                .addContainerGap())
        );

        p_step_oneLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {bt_browse, bt_remove, bt_remove_all});

        p_step_oneLayout.setVerticalGroup(
            p_step_oneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(p_step_oneLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(p_step_oneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addGroup(p_step_oneLayout.createSequentialGroup()
                        .addComponent(bt_browse)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(bt_remove)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(bt_remove_all)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );

        p_step_oneLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {bt_browse, bt_remove, bt_remove_all});

        p_step_four.setBorder(javax.swing.BorderFactory.createTitledBorder(null, LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_STEP_FOUR"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 1, 12), new java.awt.Color(0, 0, 255))); // NOI18N

        rb_destination_use_this_path.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_DESTINATION_IN_THIS_PATH"));
        rb_destination_use_this_path.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rb_destination_use_this_pathActionPerformed(evt);
            }
        });

        rb_destination_into_subfolder.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_DESTINATION_INTO_SUBFOLDER"));
        rb_destination_into_subfolder.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rb_destination_into_subfolderActionPerformed(evt);
            }
        });

        rb_destination_same_as_source_file.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_SAME_AS_INPUT_FILE"));
        rb_destination_same_as_source_file.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rb_destination_same_as_source_fileActionPerformed(evt);
            }
        });

        bt_destination_browse.setIcon(new ImageIcon("Data/Icons/Basic/Open-icon.png"));
        bt_destination_browse.setText(LocalizationManager.getCurrent_resource().getString("BROWSE"));
        bt_destination_browse.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_destination_browseActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout p_step_fourLayout = new javax.swing.GroupLayout(p_step_four);
        p_step_four.setLayout(p_step_fourLayout);
        p_step_fourLayout.setHorizontalGroup(
            p_step_fourLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(p_step_fourLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(p_step_fourLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(rb_destination_same_as_source_file)
                    .addComponent(rb_destination_into_subfolder)
                    .addComponent(rb_destination_use_this_path))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(p_step_fourLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(p_step_fourLayout.createSequentialGroup()
                        .addComponent(tf_destination_use_this_path)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(bt_destination_browse, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(tf_destination_into_subfolder))
                .addContainerGap())
        );
        p_step_fourLayout.setVerticalGroup(
            p_step_fourLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(p_step_fourLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(rb_destination_same_as_source_file)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(p_step_fourLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rb_destination_into_subfolder)
                    .addComponent(tf_destination_into_subfolder, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(p_step_fourLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rb_destination_use_this_path)
                    .addComponent(tf_destination_use_this_path, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(bt_destination_browse))
                .addContainerGap())
        );

        p_step_three.setBorder(javax.swing.BorderFactory.createTitledBorder(null, LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_STEP_THREE"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 1, 12), new java.awt.Color(0, 0, 255))); // NOI18N

        rb_same_as_source_file.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_SAME_AS_INPUT_FILE"));
        rb_same_as_source_file.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rb_same_as_source_fileActionPerformed(evt);
            }
        });

        rb_use_this_name.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_USE_THIS_NAME"));
        rb_use_this_name.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rb_use_this_nameActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout p_step_threeLayout = new javax.swing.GroupLayout(p_step_three);
        p_step_three.setLayout(p_step_threeLayout);
        p_step_threeLayout.setHorizontalGroup(
            p_step_threeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(p_step_threeLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(p_step_threeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(rb_same_as_source_file)
                    .addGroup(p_step_threeLayout.createSequentialGroup()
                        .addComponent(rb_use_this_name)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(tf_use_this_name)))
                .addContainerGap())
        );
        p_step_threeLayout.setVerticalGroup(
            p_step_threeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(p_step_threeLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(rb_same_as_source_file)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(p_step_threeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(tf_use_this_name, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(rb_use_this_name))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout p_all_componentsLayout = new javax.swing.GroupLayout(p_all_components);
        p_all_components.setLayout(p_all_componentsLayout);
        p_all_componentsLayout.setHorizontalGroup(
            p_all_componentsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, p_all_componentsLayout.createSequentialGroup()
                .addGap(8, 8, 8)
                .addComponent(p_step_one, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(p_all_componentsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(p_step_two, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(p_step_three, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(p_step_four, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        p_all_componentsLayout.setVerticalGroup(
            p_all_componentsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(p_all_componentsLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(p_all_componentsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(p_all_componentsLayout.createSequentialGroup()
                        .addComponent(p_step_two, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(p_step_three, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(p_step_four, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(p_step_one, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );

        bt_cancel.setText(LocalizationManager.getCurrent_resource().getString("CANCEL"));
        bt_cancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_cancelActionPerformed(evt);
            }
        });

        bt_split_all.setText(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_SPLIT_ALL"));
        bt_split_all.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bt_split_allActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(711, Short.MAX_VALUE)
                .addComponent(bt_split_all)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(bt_cancel)
                .addContainerGap())
            .addComponent(p_all_components, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(p_all_components, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(bt_cancel)
                    .addComponent(bt_split_all))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void bt_remove_allActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_remove_allActionPerformed
        // make sure that there are some files inserted
        if (t_files_to_be_splitted.getRowCount() == 0) {
            // show an error message
            JOptionPane.showMessageDialog(null, LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_NO_FILES_TO_REMOVE"),
                    LocalizationManager.getCurrent_resource().getString("ERROR"), 0);
            return;
        }

        // remove all files from the list
        while (t_files_to_be_splitted.getRowCount() != 0) {
            ((DefaultTableModel) t_files_to_be_splitted.getModel()).removeRow(0);
        }
        // disable the other steps until a table selection is made
        enableAllComponents(false);
}//GEN-LAST:event_bt_remove_allActionPerformed

    private void bt_browseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_browseActionPerformed
        // choose file location
        JFileChooser file_chooser = new JFileChooser();

        file_chooser.setDialogTitle(LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_FILE_CHOOSER_TITLE"));
        file_chooser.setMultiSelectionEnabled(false);
        file_chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        file_chooser.setFileFilter(new FileNameExtensionFilter("Pdf files (*.pdf)", "pdf"));

        if (file_chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
            if (PDFManager.isPdf(file_chooser.getSelectedFile().getAbsolutePath()) == true) {
                // get number of page in the pdf file
                int number_of_pages = PDFManager.getNumberOfPages(file_chooser.getSelectedFile().getAbsolutePath());
                // add the file to the table model
                ((DefaultTableModel) t_files_to_be_splitted.getModel()).addRow(new Object[]{file_chooser.getSelectedFile().getName(),
                            PDFManager.getFileSizeFormatted(file_chooser.getSelectedFile().getAbsolutePath()), number_of_pages});
                // select the file just added (the last index in the table)
                t_files_to_be_splitted.setRowSelectionInterval(t_files_to_be_splitted.getRowCount() - 1, t_files_to_be_splitted.getRowCount() - 1);
                // enable the other steps
                enableAllComponents(true);
            }
        }
}//GEN-LAST:event_bt_browseActionPerformed

    private void bt_removeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_removeActionPerformed
        // make sure that there is a file selected
        if (t_files_to_be_splitted.getSelectedRow() == -1) {
            // show an error message
            JOptionPane.showMessageDialog(null, LocalizationManager.getCurrent_resource().getString("SPLITTER_UI_NO_FILE_SELECTED"),
                    LocalizationManager.getCurrent_resource().getString("ERROR"), 0);
            return;
        }

        // remove the selected file from the list
        ((DefaultTableModel) t_files_to_be_splitted.getModel()).removeRow(t_files_to_be_splitted.getSelectedRow());
        // disable the other steps until a table selection is made
        enableAllComponents(false);
}//GEN-LAST:event_bt_removeActionPerformed

    private void windowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_windowClosing
        // close the frame
        this.dispose();
        // indicate that the frame is hidden
        is_component_visible = false;
        LoggerManager.getLogger().log(Level.INFO, "Frame hidden \"{0}\".", "SplitterUI");
    }//GEN-LAST:event_windowClosing

    private void rb_even_and_oddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rb_even_and_oddActionPerformed
        activateSplitMethodComponents(SPLIT_METHOD.even_odd);
    }//GEN-LAST:event_rb_even_and_oddActionPerformed

    private void rb_into_n_pagesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rb_into_n_pagesActionPerformed
        activateSplitMethodComponents(SPLIT_METHOD.into_n_pages);
    }//GEN-LAST:event_rb_into_n_pagesActionPerformed

    private void rb_from_toActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rb_from_toActionPerformed
        activateSplitMethodComponents(SPLIT_METHOD.page_range);
    }//GEN-LAST:event_rb_from_toActionPerformed

    private void rb_into_n_partsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rb_into_n_partsActionPerformed
        activateSplitMethodComponents(SPLIT_METHOD.into_n_parts);
    }//GEN-LAST:event_rb_into_n_partsActionPerformed

    private void rb_extract_pagesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rb_extract_pagesActionPerformed
        activateSplitMethodComponents(SPLIT_METHOD.extract_pages);
    }//GEN-LAST:event_rb_extract_pagesActionPerformed

    private void rb_remove_pagesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rb_remove_pagesActionPerformed
        activateSplitMethodComponents(SPLIT_METHOD.remove_pages);
    }//GEN-LAST:event_rb_remove_pagesActionPerformed

    private void bt_cancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_cancelActionPerformed
        windowClosing(null);
    }//GEN-LAST:event_bt_cancelActionPerformed

private void rb_same_as_source_fileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rb_same_as_source_fileActionPerformed
    activateSplitOutputFileName(SPLIT_OUTPUT_NAME.same_as_input_file);
}//GEN-LAST:event_rb_same_as_source_fileActionPerformed

private void rb_use_this_nameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rb_use_this_nameActionPerformed
    activateSplitOutputFileName(SPLIT_OUTPUT_NAME.use_this_name);
}//GEN-LAST:event_rb_use_this_nameActionPerformed

private void rb_destination_same_as_source_fileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rb_destination_same_as_source_fileActionPerformed
    activateSplitOutputFileLocation(SPLIT_OUTPUT_LOCATION.same_as_input_file);
}//GEN-LAST:event_rb_destination_same_as_source_fileActionPerformed

private void rb_destination_use_this_pathActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rb_destination_use_this_pathActionPerformed
    activateSplitOutputFileLocation(SPLIT_OUTPUT_LOCATION.in_this_path);
}//GEN-LAST:event_rb_destination_use_this_pathActionPerformed

private void rb_destination_into_subfolderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rb_destination_into_subfolderActionPerformed
    activateSplitOutputFileLocation(SPLIT_OUTPUT_LOCATION.into_a_subfolder);
}//GEN-LAST:event_rb_destination_into_subfolderActionPerformed

private void bt_destination_browseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_destination_browseActionPerformed
    JFileChooser file_chooser = new JFileChooser();
    file_chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);

    if (file_chooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
        tf_destination_use_this_path.setText(file_chooser.getSelectedFile().getAbsolutePath());
    }
}//GEN-LAST:event_bt_destination_browseActionPerformed

    private void bt_split_allActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt_split_allActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_bt_split_allActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup bg_output_file_location;
    private javax.swing.ButtonGroup bg_output_file_name;
    private javax.swing.ButtonGroup bg_split_method_selector;
    private javax.swing.JButton bt_browse;
    private javax.swing.JButton bt_cancel;
    private javax.swing.JButton bt_destination_browse;
    private javax.swing.JButton bt_remove;
    private javax.swing.JButton bt_remove_all;
    private javax.swing.JButton bt_split_all;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel l_extract_pages_note;
    private javax.swing.JLabel l_into_n_parts;
    private javax.swing.JLabel l_pages;
    private javax.swing.JLabel l_remove_pages_note;
    private javax.swing.JLabel l_to_page;
    private javax.swing.JPanel p_all_components;
    private javax.swing.JPanel p_step_four;
    private javax.swing.JPanel p_step_one;
    private javax.swing.JPanel p_step_three;
    private javax.swing.JPanel p_step_two;
    private javax.swing.JRadioButton rb_destination_into_subfolder;
    private javax.swing.JRadioButton rb_destination_same_as_source_file;
    private javax.swing.JRadioButton rb_destination_use_this_path;
    private javax.swing.JRadioButton rb_even_and_odd;
    private javax.swing.JRadioButton rb_extract_pages;
    private javax.swing.JRadioButton rb_from_to;
    private javax.swing.JRadioButton rb_into_n_pages;
    private javax.swing.JRadioButton rb_into_n_parts;
    private javax.swing.JRadioButton rb_remove_pages;
    private javax.swing.JRadioButton rb_same_as_source_file;
    private javax.swing.JRadioButton rb_use_this_name;
    private javax.swing.JTable t_files_to_be_splitted;
    private javax.swing.JTextField tf_destination_into_subfolder;
    private javax.swing.JTextField tf_destination_use_this_path;
    private javax.swing.JTextField tf_extract_pages;
    private javax.swing.JTextField tf_from_page;
    private javax.swing.JTextField tf_into_n_pages;
    private javax.swing.JTextField tf_into_n_parts;
    private javax.swing.JTextField tf_remove_pages;
    private javax.swing.JTextField tf_to_page;
    private javax.swing.JTextField tf_use_this_name;
    // End of variables declaration//GEN-END:variables
}
